package org.soarsky.wealthchengdu.module.info;

import java.util.ArrayList;

import org.soarsky.wealthchengdu.R;
import org.soarsky.wealthchengdu.appliction.MyAppliction;

import android.annotation.SuppressLint;
import android.content.res.ColorStateList;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class Horizontal_adapter extends BaseAdapter{
	private static final ColorStateList A31300 = null;
	private int number;
	int s=0;
	private static String[] dataObjects = new String[]
			{"聚焦成都","世说成都" ,"成都愿景","成都坐标","成都概览","成都镜像","成都指南"};
    private ArrayList<String [] > list;
    private String [] stringName;
	@Override
	public int getCount() {
		return stringName.length;
	}

	public void setlistdata(String [] stringName)
	{
		this.stringName=stringName;
		this.notifyDataSetChanged();
	}
	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@SuppressLint("ResourceAsColor")
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		View retval = LayoutInflater.from(parent.getContext()).inflate(
				R.layout.horiaontal_listviwe_item, null);
		TextView title = (TextView) retval.findViewById(R.id.horiaontal_tv_text);
		title.setText(stringName[position]);
		if(MyAppliction.mChoose==position){
			title.setBackgroundResource(R.drawable.hor_bg_up);
			title.setTextColor(parent.getContext().getResources().getColor(R.color.ndis));
		}
//		else
//		{
//			title.setBackgroundResource(R.drawable.hor_bg_down);
//		}

		return retval;
	}

}
